package com.ruoyi.project.web.videoInfo.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.web.videoInfo.mapper.VideoInfoMapper;
import com.ruoyi.project.web.videoInfo.domain.VideoInfo;
import com.ruoyi.project.web.videoInfo.service.IVideoInfoService;
import com.ruoyi.common.utils.text.Convert;

/**
 * 学习视频Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-01-21
 */
@Service
public class VideoInfoServiceImpl implements IVideoInfoService 
{
    @Autowired
    private VideoInfoMapper videoInfoMapper;

    /**
     * 查询学习视频
     * 
     * @param videoId 学习视频ID
     * @return 学习视频
     */
    @Override
    public VideoInfo selectVideoInfoById(Long videoId)
    {
        return videoInfoMapper.selectVideoInfoById(videoId);
    }

    /**
     * 查询学习视频列表
     * 
     * @param videoInfo 学习视频
     * @return 学习视频
     */
    @Override
    public List<VideoInfo> selectVideoInfoList(VideoInfo videoInfo)
    {
        return videoInfoMapper.selectVideoInfoList(videoInfo);
    }

    /**
     * 新增学习视频
     * 
     * @param videoInfo 学习视频
     * @return 结果
     */
    @Override
    public int insertVideoInfo(VideoInfo videoInfo)
    {
        videoInfo.setCreateTime(DateUtils.getNowDate());
        return videoInfoMapper.insertVideoInfo(videoInfo);
    }

    /**
     * 修改学习视频
     * 
     * @param videoInfo 学习视频
     * @return 结果
     */
    @Override
    public int updateVideoInfo(VideoInfo videoInfo)
    {
        return videoInfoMapper.updateVideoInfo(videoInfo);
    }

    /**
     * 删除学习视频对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteVideoInfoByIds(String ids)
    {
        return videoInfoMapper.deleteVideoInfoByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除学习视频信息
     * 
     * @param videoId 学习视频ID
     * @return 结果
     */
    @Override
    public int deleteVideoInfoById(Long videoId)
    {
        return videoInfoMapper.deleteVideoInfoById(videoId);
    }
}
